home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-02-27 | 1.4 KB | 63 lines | [TEXT/PJMM] |
- { JumpCDEFIntf }
- {}
- { Interface for the JumpCDEF resource stub }
- {}
- { Copyright © Sebastiano Pilla 1996 }
- { All rights reserved }
-
- { <mailto:case@tvol.it> }
-
- { Add this unit to your projects to have ability of debugging the CDEF in your favourite }
- { source level debugger. See the file JumpCDEF Info for documentation details }
-
- unit JumpCDEFIntf;
-
-
- interface
-
-
- { InstallCDEFUPP }
- {}
- { Installs a real control definition procedure into the jump record }
- {}
- { Entry: inControlDefProcPtr = pointer to the real control definition procedure }
- { Exit: function result = error code }
- function InstallCDEFUPP (inControlDefProc: ControlDefProcPtr): OSErr;
-
-
- implementation
-
-
- const
- kCDEFJumpResType = 'CJMP'; { resource type of the 'CJMP' resource }
- kCDEFJumpResID = 128; { resource ID of the 'CJMP' resource }
-
-
- type
- CDEFJumpHandle = ^CDEFJumpPtr;
- CDEFJumpPtr = ^CDEFJumpRec;
- CDEFJumpRec = record
- fRealDefUPP: ControlDefUPP;
- end;
-
-
- function InstallCDEFUPP (inControlDefProc: ControlDefProcPtr): OSErr;
- var
- jmpHdl: CDEFJumpHandle;
- err: OSErr;
- begin
- jmpHdl := CDEFJumpHandle(GetResource(kCDEFJumpResType, kCDEFJumpResID));
- err := ResError;
- if (jmpHdl <> nil) and (err = noErr) then
- begin
- HLock(Handle(jmpHdl));
- jmpHdl^^.fRealDefUPP := NewControlDefProc(inControlDefProc);
- HUnlock(Handle(jmpHdl));
- ChangedResource(Handle(jmpHdl));
- HNoPurge(Handle(jmpHdl));
- end;
- InstallCDEFUPP := err;
- end;
-
-
- end.